{% extends "WebMainSiteBundle:User:layout.html.twig" %}
{% set title = "基本信息" %}
{% block title %}
    {{ title }}
{% endblock %}

{% block user_main %}
    <form class="form-horizontal" role="form"  method="post">
        {% if teacher.id is defined %}
            <input type="hidden" name="id" value="{{ teacher.id }}"/>
        {% endif %}
        {#{{ dump(teacher) }}#}
        <div class="row">
            <div class="col-md-12">
                <div class="form-group">
                    <div class="col-md-3 text-right"><label class="control-label">选择职称</label></div>
                    <div class="col-md-9">
                        {% if teacher.category is not defined %}{% set teacherCategory = 0 %}{% else %}{% set teacherCategory = teacher.category %}{% endif %}
                        <select name="category" class="form-control">
                            <option value="0" {% if teacherCategory == 0 %} selected="selected" {% endif %}>- 请选择职称 -</option>
                            {% for c in category %}
                                <option value="{{ c.id }}" {% if teacherCategory == c.id %} selected="selected" {% endif %}>{{ c.name }}</option>
                            {% endfor %}
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-3 text-right"><label class="control-label">姓名或昵称</label></div>
                    <div class="col-md-9">
                        <input name="name" type="text" class="form-control" id="phone" placeholder="请填写真实姓名或者笔名"  value="{{ teacher.name is defined ? teacher.name : ""  }}"/>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-3 text-right"><label class="control-label">个人简介</label></div>
                    <div class="col-md-9">
                        <textarea
                                name="intro" class="form-control" rows="11" id="info"
                                placeholder="个人简介:您的教学经验，擅长领域，教学成就等。请尽可能用简短的文字描述，以某些页面不能全面展示。"
                                >{% if teacher.intro is defined %}{{ teacher.intro }}{% endif %}</textarea>
                    </div>
                </div>
            </div>
            <p class="buttons-margin-horizontal">
                <input type="submit" class="btn btn-theme btn-green" value="修改" />
            </p>
        </div>
    </form>
{% endblock %}

{% block myJs %}
    {% include "AssetsUploadBundle:MyUpload:inc.html.twig" %}
{% endblock %}